package cdu.sl.utils;


public class CurrentHolder {
    private static final ThreadLocal<Integer> CURRENT_LOCAL = new ThreadLocal<>();
    /**
     * 存储当前员工的id
     *
     * @param employeeId
     */
    public static void setCurrentId(Integer employeeId) {
        CURRENT_LOCAL.set(employeeId);
    }

    /**
     * 获取当前员工的id
     *
     * @return
     */
    public static Integer getCurrentId() {
        return CURRENT_LOCAL.get();
    }


    /**
     * 删除存储的员工id 释放内存
     */
    public static void remove() {
        CURRENT_LOCAL.remove();
    }
}